
#ifndef CONSOLE_H_
#define CONSOLE_H_

#include <iostream>
#include <stdlib.h>
#include <list>
#include <iostream>
#include <string>
#include <getopt.h>
#include <string.h>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <vector>

#include "Client.h"
#include "../shared/DBRegister.h"

#define PROMPT "CS:~$ "
#define SPACE " "
#define HELP_SHORT "-h"
#define HELP_LONG "--help"
#define VERSION_SHORT "-v"
#define VERSION_LONG "--version"

#define INSERT_SHORT "-i"
#define INSERT_LONG "--insert"
#define REMOVE_SHORT "-r"
#define REMOVE_LONG "--remove"
#define GET_SHORT "-g"
#define GET_LONG "--get"
#define UPDATE_SHORT "-u"
#define UPDATE_LONG "--update"

#define QUIT_SHORT "-q"
#define QUIT_LONG "--quit"

class Console {

private:

	bool terminateExecution;
	Client* cliente;

	void show_help();
	void show_version();
	void doQuit();

	void insert_register(std::string &operation);
	void update_register(std::string &operation);
	void remove_register(std::string &operation);
	void get_register(std::string &operation);
	std::string get_function(std::string &operation);
	DBRegister* parseRegister(std::string operation);
	void show_waiting();

public:
	Console(Client *cliente);
	void show_inicio();
	void show_shell();
	void show_error(const std::string& error_message);
	void show_bye();
	bool quit();
};

#endif /* CONSOLE_H_ */

